<template>
	<view class="feedbackList">
		<view class="feedbackList-item" v-for="(item, index) in dataList" :key="index" @click="toDetail(item)">
			<view class="info">
				<view class="info-title text-ellipsis">
					{{item.content}}
				</view>
				<view class="info-time">{{item.create_time}}</view>
			</view>
			<image class="arrow" src="../../static/images/arrow.png" mode=""></image>
		</view>
		<view class="footer">
			<view class="btn" @click="onSave">新增</view>
		</view>
	</view>
</template>

<script>
	import reqApi from "../../api/api.js";
	export default {
		data() {
			return {
				params: {
					page: 1,
					limit: 10
				},
				dataList: []
			}
		},
		onShow() {
			this.getList();
		},
		methods: {
			onSave(){
				uni.navigateTo({
					url: "/pages/mine/feedback"
				})
			},
			toDetail(item) {
				uni.navigateTo({
					url: `/pages/mine/feedbackDetail?id=${item.feedback_id}`
				})
			},
			getList() {
				reqApi.feedbackList(this.params).then(res => {
					console.log("反馈列表", res);
					this.dataList = res.data.list;
				})
		 }
		}
	}
</script>

<style lang="scss" scoped>
	.footer {
		padding: 30rpx 40rpx;
		box-sizing: border-box;
		position: fixed;
		bottom: 0;
		width: 100%;
		background: #fff;
		z-index: 1000;
		.btn {
			width: 100%;
			height: 88rpx;
			background: #EEA800;
			border-radius: 88rpx;
			font-family: PingFang SC, PingFang SC;
			font-weight: bold;
			font-size: 32rpx;
			color: #FFFFFF;
			text-align: center;
			line-height: 88rpx;
		}
	}
	.feedbackList {
		background: #fff;

		.feedbackList-item {
			padding: 30rpx;
			box-sizing: border-box;
			display: flex;
			justify-content: space-between;
			border-bottom: 2rpx solid #eee;
			align-items: center;

			.info {
				.info-title {
					font-family: PingFang SC, PingFang SC;
					font-weight: 400;
					font-size: 32rpx;
					color: #333333;
				}

				.info-time {
					font-family: PingFang SC, PingFang SC;
					font-weight: 400;
					font-size: 24rpx;
					color: #CCCCCC;
					margin-top: 20rpx;
				}
			}

			.arrow {
				width: 48rpx;
				height: 48rpx;
			}
		}
	}
</style>
